/* 
 *  <copyright file="CircleBodyCmp.cs" company="Wesley Jowitt">
 *  
 *  SobrietyEngine: Copyright (c) 2011 Wesley Jowitt
 *  
 *  This software is distributed under a software license.
 *   * As of the creation time of this file, the license in use is the Microsoft Permissive License (Ms-PL) 
 *    * The license can be viewed at:
 *     * License.Txt in the root folder of this project
 *      * http://sobrietyengine.codeplex.com/license
 *       * http://www.microsoft.com/opensource/licenses.mspx
 *       
 *  </copyright>
 *   */

using System;


using FarseerPhysics.Factories;


namespace SobrietyEngine.Components.Physics
{
    public class CircleBodyCmp:FarseerPhysicsCmp, SobrietyEngine.Components.IComponent
    {
        float radius;
        
        public CircleBodyCmp()
            : base()
        {
            
        }

        public CircleBodyCmp(String _worldName, float _radius)
            : base(_worldName)
        {
            radius = _radius;
        }

         override public Boolean InitComponent()
        {
            physicsGameService = Actor.GameServices().PhysicsGameService;
            world = physicsGameService.Worlds[physicsWorldName];

            Body = BodyFactory.CreateCircle(world, radius, Mass);

            base.InitComponent();

            return true;     
        } 
    }
}